package pers.zc.activiti.shejimoshi.dongtaidaili;

/**
 * @Annotion: 静态工厂
 * @ClassName: Context
 * @Author: Lin Fuyuan
 * @Date: 2019/11/14  17:57
 * @Version: 1.0
 */
public class ContextFactory {
    public static Proxy getInstance(Class clazz){
        Proxy proxy = null;
        try{
            proxy =(Proxy)clazz.newInstance();
        }catch(Exception e){
            e.printStackTrace();
        }
        return proxy;
    }

    /**
     *
     * @param className
     * @return
     */
    public static Proxy getInstance(String className){
        Proxy proxy = null;
        try{
            proxy = (Proxy)Class.forName(className).newInstance();
        }catch(Exception e){
            e.printStackTrace();
        }
        return proxy;
    }
}
